package com.zzw.utils.error;

/**
 * @author zzw
 * @version 1.0
 * @title CommonError
 * @description <p>公共错误类</p>
 * @datetime 2022-12-28 8:53 下午
 */
public enum CommonError implements BaseError {

    ILLEGAL_ARGUMENT("ILLEGAL_ARGUMENT", "非法参数"),

    DATA_EXIST("DATA_EXIST", "数据已存在"),

    SYSTEM_ERROR("SYSTEM_ERROR", "系统异常"),

    ;

    /**
     * 错误码
     */
    private final String errorCode;

    /**
     * 错误描述
     */
    private final String errorMessage;

    CommonError(String errorCode, String errorMessage) {
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    @Override
    public String getCode() {
        return errorCode;
    }

    @Override
    public String getErrorMsg() {
        return errorMessage;
    }
}
